<template>
   <router-view/>
<!-- <el-button type="primary" @click="handleLogin">测试登录</el-button>-->
<!--<el-button type="danger" @click="handleUserList">测试获取用户请求</el-button>-->
</template>

<script setup>
import {watch} from "vue";
import {useRoute,useRouter} from "vue-router";
import store from "@/store";
const route =useRoute();
const router = useRouter();
const whitePath=['/login','/index','/'];
import routerr from "@/router/index";


watch(route,(to,from)=>{
   if(to.name===undefined){
   }
  console.log("to:"+to.name)
  console.log(to.path)

  if(whitePath.indexOf(to.path)===-1){

    let obj = {
      name: to.name,
      path: to.path
    }
    store.commit("ADD_TABS",obj)
  }

},{deep:true,immediate:true})



</script>

<style>

</style>